﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace Part3_IndividuleAssignment2.Models
{
    public class NewsItem
    {
        public int ID { get; set; }

        [Required(ErrorMessage="Message content is required.")]
        [MaxLength(500,ErrorMessage="Message must be no more than 500 characters")]
        public string Content { get; set; }

        [Required]
        public DateTime PostTime { get; set; }
        
        [Required]
        public virtual Account Account { get; set; }

        public NewsItem()
        {
            PostTime = DateTime.Now;
        }
    }
}